home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Franz PD / Franz PD Disk #111 (1991-01)(Amiga User Group Deutschland e.V.).zip / Franz PD Disk #111 (1991-01)(Amiga User Group Deutschland e.V.).adf / Demos / Demo.asm < prev    next >
Assembly Source File  |  1989-07-03  |  4KB  |  139 lines

  1. ; Demo von E.Hambuch
  2. ; Handwarecodiert dank des Hardwarekurses im AMIGA-Magazin
  3. ; Freeware Bitte nicht verändern !
  4. ; Bitte Textdatei lesen !
  5. ; Quellcode für A68k-Assembler
  6.   CODE CHIP CHIP
  7. MEMF_CLEAR: equ $10000
  8. MEMF_PUBLIC: equ $1
  9. MEMF_CHIP:  equ $2
  10.   include 'startup.i'     ;nur für Workbench-Start nötig
  11. SCREEN_WIDTH:   equ 320
  12. SCREEN_HEIGHT:  equ 256
  13. EMPIRE_WIDTH:   equ 288   ;Breite des Logos
  14. EMPIRE_HEIGHT:  equ 44    ;und Höhe
  15. _main:
  16.   move.l 4,a6     ;Speicher für Bildschirm 2 Planes
  17.   move.l #SCREEN_WIDTH/8*SCREEN_HEIGHT*2,d0
  18.   move.l #MEMF_CLEAR!MEMF_PUBLIC!MEMF_CHIP,d1
  19.   jsr -198(a6)  ;AllocMem
  20.   move.l d0,Memory
  21.   beq ende
  22.   move.l d0,d1                     ;und in CopList eintragen
  23.   add.l #SCREEN_WIDTH/8*SCREEN_HEIGHT,d1
  24.   move.w d0,Plane0.1
  25.   swap d0
  26.   move.w d0,Plane0.0
  27.   move.w d1,Plane1.1
  28.   swap d1
  29.   move.w d1,Plane1.0
  30.   move.w #$4000,$dff09a          ;Disable
  31.   move.l #CopList,$dff084        ;Copperliste aktivieren
  32.   move.w #0,$dff08a            ;Copper-Strobe auslösen
  33.                             ;niemals mit CLR.W !!!!!
  34. forever:
  35.   btst #6,$bfe001          ;Mausknopf ?
  36.   beq closeall
  37.   move.l $dff004,d0
  38.   and.l #$00013000,d0
  39.   cmp.l #$00013000,d0     ;auf Rasterzeile $130 warten
  40.   bne.s forever
  41.   move.w #%0000000100000000,Blitmode
  42.   lea Empire,a0          ;Löschen
  43.   move.l Memory,a1
  44.   bsr blit
  45.   lea Empire+(EMPIRE_WIDTH/8*EMPIRE_HEIGHT),a0
  46.   move.l Memory,a1
  47.   add.l #SCREEN_WIDTH/8*SCREEN_HEIGHT,a1
  48.   bsr blit
  49.   move.w #%0000100111110000,Blitmode
  50.   move.w RichtX,d0
  51.   add.w  d0,XPos
  52.   move.w RichtY,d1
  53.   add.w  d1,YPos
  54.   cmp.w #SCREEN_WIDTH-EMPIRE_WIDTH+16,XPos  ;rechter Rand
  55.   bne.s w1
  56.   neg.w RichtX          ;ja->Richtung unkehren
  57. w1:
  58.   tst.w XPos            ;linker Rand
  59.   bne.s w2
  60.   neg.w RichtX
  61. w2:
  62.   cmp.w #SCREEN_HEIGHT-EMPIRE_HEIGHT,YPos ;unterer Rand
  63.   bne.s w3
  64.   neg.w RichtY
  65. w3:
  66.   tst.w YPos
  67.   bne.s w4
  68.   neg.w RichtY
  69. w4:
  70.   lea Empire,a0            ;und beide Planes an neue Position setzen
  71.   move.l Memory,a1
  72.   bsr blit
  73.   lea Empire+(EMPIRE_WIDTH/8*EMPIRE_HEIGHT),a0
  74.   move.l Memory,a1
  75.   add.l #SCREEN_WIDTH/8*SCREEN_HEIGHT,a1
  76.   bsr blit
  77.   bra forever
  78. closeall:
  79.   move.w #$c000,$dff09a          ;Enable
  80.   move.l Memory,a1               ;Speicher freigeben !!
  81.   move.l #SCREEN_WIDTH/8*SCREEN_HEIGHT*2,d0
  82.   move.l 4,a6
  83.   jsr -210(A6) ;FreeMem
  84. ende: rts
  85. blit:
  86.   btst #14,$dff002         ;auf Blitter warten
  87.   bne.s blit
  88.   clr.w $dff064        ;AMOD
  89.   move.w #(SCREEN_WIDTH-EMPIRE_WIDTH)/8,$dff066 ;DMOD
  90.   move.l #$ffff0000,$dff044  ;AMASK LEFT,RIGHT
  91.   moveq #0,d0
  92.   move.w XPos,d0
  93.   move.l d0,d1
  94.   and.w #$f,d0
  95.   ror.w #4,d0            ;Rechtsverschiebung um max. 15 Punkte
  96.   or.w Blitmode,d0
  97.   move.w d0,$dff040      ;in BLTCON0
  98.   clr.w $dff042          ;BLTCON1
  99.   lsr.w #3,d1            ;Anzahl der Bytes
  100.   bclr #0,d1
  101.   add.l d1,a1
  102.   move.w YPos,d1         ;YPosition
  103.   mulu #SCREEN_WIDTH/8,d1
  104.   add.l d1,a1
  105.   move.l a0,$dff050     ;APTH
  106.   move.l a1,$dff054     ;DPTH
  107.   move.w #EMPIRE_HEIGHT*64+(EMPIRE_WIDTH/16),$dff058 ;BLTSIZE und start
  108.   rts
  109. Memory: ds.l 1
  110. XPos: dc.w SCREEN_WIDTH/2-(EMPIRE_WIDTH/2)  ;Zentriert
  111. YPos: dc.w SCREEN_HEIGHT/2-(EMPIRE_HEIGHT/2)
  112. RichtX: dc.w 1
  113. RichtY: dc.w 1
  114. Blitmode: ds.w 1
  115. WAIT: macro
  116.   dc.w \1*$100|$f,-2
  117.   endm
  118. COLOR: macro
  119.   dc.w $180,\1
  120.   endm
  121. CopList:
  122.   dc.w $96,$20  ;Sprites off
  123.   dc.w $e0           ;Bitplanes
  124. Plane0.0:  dc.w 0,$e2
  125. Plane0.1:  dc.w 0,$e4
  126. Plane1.0:  dc.w 0,$e6
  127. Plane1.1:  dc.w 0
  128.   dc.w $8e,$3081,$90,$30c1,$92,$38,$94,$d0 ;320 x 256
  129.   dc.w $108,0,$10a,0 ;Moduli
  130.   dc.w $180,$000,$182,$ccc,$184,$888,$186,$f00  ;Colors
  131.   dc.w $100,%0010001000000000 ;LoRes 2 Planes
  132.   dc.l -2 ;End
  133.   xref Empire   ;Bild LoRes 4 Farben malen der Größe wie oben
  134.                 ;angegeben und als Brush abspeichern. Mit Iff-Converter
  135.                 ;umwandeln und mit Dump2Hunk behandeln. Dann die Bilddatei
  136.                 ;dazulinken.
  137.                 ;nicht vergessen die Farben noch einzutragen (unter Colors)
  138.   end
  139.